package eteam.aps.common.entity;

import io.swagger.annotations.ApiModel;

/**
 * 分页基本信息
 *
 * @author LiuLei
 */
@ApiModel(value = "分页", description = "PageQuery")
public class PageQuery {

    private int page = 1;

    private int size = 10;

    private int offSize;

    public PageQuery() {
    }

    public PageQuery(int page, int size) {
        this.page = page;
        this.size = size;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        if (page < 1) page = 1;
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        if (size < 1 || size > 100) size = 10;
        this.size = size;
    }

    public int offSize() {
        offSize = (page - 1) * size;
        return offSize;
    }
}
